package com.bestcem.xm.survey.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

@Getter
@AllArgsConstructor
public enum RespondentStatusEnum {

    RESPONDENT_STATUS_BEGIN(0, "进行中"),
    RESPONDENT_STATUS_FINISH(1, "成功完成"),
    RESPONDENT_STATUS_SCREEN_OUT(2, "被甄别"),
    RESPONDENT_STATUS_QUOTA_FULL(3, "配额满"),
    RESPONDENT_STATUS_SYSTEM_SCREEN_OUT(4, "系统甄别"),
    RESPONDENT_STATUS_HIDDEN(5, "成功完成(隐藏)"),
    RESPONDENT_STATUS_BACKUP(6, "备用"),
    RESPONDENT_STATUS_DISCARD(7, "废弃"),
    RESPONDENT_STATUS_OVERFULL(8, "超额"),
    RESPONDENT_STATUS_OPEN(9, "已打开"),
    RESPONDENT_STATUS_UNFINISH(10, "未完成"),
    RESPONDENT_STATUS_DELETE(107, "彻底删除");

    @EnumValue
    private final Integer value;
    private final String desc;

    public static List<Integer> getRespondentStatus4Check() {
        return Arrays.stream(RespondentStatusEnum.values())
                .map(RespondentStatusEnum::getValue)
                .filter(oneValue -> oneValue > 0)
                .collect(Collectors.toList());
    }
}
